#ifndef CONFIGMANAGER_H
#define CONFIGMANAGER_H

#include <QFile>
#include <QMap>
#include <QMessageBox>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonDocument>
#include <QByteArray>

class ConfigManager
{
public:
    static ConfigManager* instance(QString work_path);
    static ConfigManager* instance();

    enum DeviceType{
        IOS = 1,
        ANDROID = 2,
        HOST = 3,
        OTHER = 4,
    };

    QString getConfigPath();
    int getDeviceType(QString device);
    QString getDeviceName(QString device);
    QString toString();
    void readConfigFile();

private:
    ConfigManager(QString work_path);
    ~ConfigManager();
    ConfigManager(const ConfigManager&) = delete;
    ConfigManager& operator=(const ConfigManager&) = delete;

    void initConfigFile();

    static ConfigManager* instance_p;

    QString work_path;
    QJsonObject deviceData;
};

#endif // CONFIGMANAGER_H
